  <%@include file="includes/head.jsp" %>
<%@include file="includes/top.jsp" %>
<%@include file="includes/menu.jsp" %>

  <div class="page-content"> 
    <!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
    <div id="portlet-config" class="modal hide">
      <div class="modal-header">
        <button data-dismiss="modal" class="close" type="button"></button>
        <h3>Widget Settings</h3>
      </div>
      <div class="modal-body"> Widget settings form goes here </div>
    </div>
    <div class="clearfix"></div>
    <div class="content">  
		<div class="page-title">	
			<h3>Historial de Comprobantes</h3>		
		</div>
    
           <div class="row">
            <div class="col-md-12">
              <div class="grid simple">
                <div class="grid-title no-border">
                              <h4>Buscar  <span class="semi-bold">Comprobantes</span></h4>
                
                  <div class="tools"> <a href="javascript:;" class="collapse"></a> <a href="#grid-config" data-toggle="modal" class="config"></a> <a href="javascript:;" class="reload"></a> <a href="javascript:;" class="remove"></a> </div>
                </div>
                <div class="grid-body no-border">
<form method=post action=HistorialBuscarServlet class="form-horizontal" role="form">
                           
                      <div class="form-group">
                        <label class="form-label">Nro de Comprobante</label>
						<div class="input-with-icon  right">                                       
							<i class=""></i>
							<input type="text" name="comprobante" id="comprobante" class="form-control">                                 
						</div>
                      </div>
                      <div class="form-group">
                        <label class="form-label">Cliente</label>
						<div class="input-with-icon  right">                                       
							<i class=""></i>
							<input type="text" name="cliente" id="cliente" class="form-control">                                 
						</div>
                      </div>
                      <div class="form-group">
                        <label class="form-label">Fecha de Inicio</label>
						<div class="input-with-icon  right">                                       
							<i class=""></i>

<div class="input-append success date col-md-10 col-lg-6 no-padding">
                    <input type="text" class="form-control" name="f1" id="f1" placeholder="Fecha de Nacimiento">
                    <span class="add-on"><span class="arrow"></span><i class="fa fa-th"></i></span> </div>	
                    <div class="clearfix"></div>	
                    
                    					</div>
                      </div>
                      
                      <div class="form-group">
                        <label class="form-label">Fecha de Fin</label>
						<div class="input-with-icon  right">                                       
							<i class=""></i>

<div class="input-append success date col-md-10 col-lg-6 no-padding">
                    <input type="text" class="form-control" name="f2" id="f2" placeholder="Fecha de Nacimiento">
                    <span class="add-on"><span class="arrow"></span><i class="fa fa-th"></i></span> </div>	
                    
                    <div class="clearfix"></div>	
                    					</div>
                      </div>
                      
				  <div class="form-actions">  
					<div class="pull-right">
					  <button type="submit" class="btn btn-success btn-cons"><i class="icon-ok"></i> Busqueda</button>
					  <button type="button" class="btn btn-white btn-cons">Limpiar</button>
					</div>
					</div>
				</form>
                </div>
              </div>
            </div>		

          </div>	
          
          
                  
   <div class="row-fluid">
        <div class="span12">
          <div class="grid simple ">
            <div class="grid-title">
              <h4>Listado de  <span class="semi-bold">Comprobantes</span></h4>
              <div class="tools"> <a href="javascript:;" class="collapse"></a> <a href="#grid-config" data-toggle="modal" class="config"></a> <a href="javascript:;" class="reload"></a> <a href="javascript:;" class="remove"></a> </div>
            </div>
            <div class="grid-body ">
                <table class="table table-hover table-condensed" id="example">
                <thead>
                  <tr>
                   
                  <th width="27" height="28" scope="col"></th>
          	<th width="57" scope="col">Tipo</th>

		    <th width="141" height="28" scope="col">Nro.</th>
		    <th width="198" scope="col">Nombre Due&ntilde;o</th>
		    <th width="133" scope="col">RUC</th>
		    <th width="308" scope="col">Direccion</th>
		    <th width="200" scope="col">F Registros</th>
		    <th width="88" scope="col">Estado</th>
                  </tr>
                </thead>
                <tbody>
                
                
                <%@page import="java.util.*, veterinaria.modelo.Comprobante" %>
		<%
		Collection<Comprobante> arreglo = (ArrayList<Comprobante>)request.getAttribute("comprobantes");
		if(arreglo != null) { 
		int i = 1;
		for(Comprobante x : arreglo) {
		%>  
		  <tr>
		    <td><%=i++ %></td>
		    <td><% out.print(x.getTipo()); %></td>
		    <td><% out.print(x.getIdComprobante()); %></td>
  		    <td><% out.print(x.getCliente().getNombreCompleto()); %></td>
  		    <td><% out.print(x.getCliente().getRucdni()); %></td>
  		    <td><% out.print(x.getCliente().getDireccion()); %></td>

		    <td><% out.print(x.getFechaRegistro()); %></td>
		    <td><% out.print(x.getEstado()); %></td>
		    
		  </tr>
		<% }  
		  } %>
                 
                 
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
      
      
      
       </div>
      
    
  </div>
  
  
  
<%@include file="includes/foot.jsp" %>
 <script type="text/javascript">
 $('.input-append.date').datepicker({
		autoclose: true,
		todayHighlight: true,
		  format: 'yyyy-mm-dd'
});

 </script>
